﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using Fuse8.ContentManagementFramework.Domain;
using Fuse8.ContentManagementFramework.Domain.Bases;

namespace Fuse8.ContentManagementFramework.Administration.Models
{
    public class CmsModuleModel : ISiteAwareEntityObject
    {
        public CmsModuleModel()
        {
            SiteCategory = SiteAwareCategory.AllSiteGroups;
        }

        [Required(ErrorMessage = "Please enter module name")]
        public string ModuleName { get; set; }
        public string ModuleDescription { get; set; }
        public int Id { get; set; }
        public int? SiteGroupId { get; set; }
        public int? SiteId { get; set; }
        public SiteAwareCategory SiteCategory { get; private set; }
        public string PartialViewName { get; set; }
        public string PartialAdministrationViewName { get; set; }
        public string ActionController { get; set; }
        public string ActionName { get; set; }
        public string PartialModelType { get; set; }
        public object CommonParameter { get; set; }

        public PageControlTypeKind ControlType { get; set; }

        public IEnumerable<SelectListItem> AvailableTypes
        {
            get
            {
                yield return new SelectListItem(){Value = PageControlTypeKind.MvcPartial.ToString(), Text = "Partial View"};
                yield return new SelectListItem() { Value = PageControlTypeKind.MvcAction.ToString(), Text = "Action" };
            }
        }
    }
}